package org.ala.tiktools.sharddb.mybatis.pager.parameter;

import org.ala.tiktools.sharddb.mybatis.router.ShardInfo;
import org.springframework.util.ClassUtils;

import java.lang.reflect.Method;
import java.util.Map;

/**
 * 查询数量方法
 *
 * @author ala
 * @date 2025-03-06 16:27
 */
public class CountMethod {
    /**
     *  执行方法的对象
     */
    protected Object proxy;
    /**
     *  执行方法体
     */
    protected Method method;
    /**
     *  分库分表参数
     */
    protected Map<ShardInfo, Object[]> args;

    public static CountMethod build(Object proxy, Method method, Map<ShardInfo, Object[]> args) {
        CountMethod cm = new CountMethod();
        cm.proxy = proxy;
        cm.method = method;
        cm.args = args;
        return cm;
    }

    /**
     *  method的每个方法Param与下标对应关系
     */


    public Object getProxy() {
        return proxy;
    }

    public void setProxy(Object proxy) {
        this.proxy = proxy;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public Map<ShardInfo, Object[]> getArgs() {
        return args;
    }

    public void setArgs(Map<ShardInfo, Object[]> args) {
        this.args = args;
    }
}
